package com.ydw.fastjson;

import com.alibaba.fastjson.JSON;
import com.ydw.model.Person;

/**
 * Created by ydw on 2017/7/5.
 */
public class FastJsonTest {
    public static void main(String[] args) {
        Person person = new Person();
        person.setAge(18);
        person.setName("ydw");
        person.setId(1L);
        String ydwStr = JSON.toJSONString(person);
        System.out.println(ydwStr);

        Person ydwObj = JSON.parseObject(ydwStr, Person.class);
        System.out.println(ydwObj);
    }
}
